<ion-header>
  <ion-navbar>
    <ion-title>工作台</ion-title>
    <ion-buttons end>
      <button ion-button *ngIf="!isEdit" (click)="beginEdit()">编辑</button>
      <button ion-button *ngIf="isEdit" (click)="completeEdit()">完成</button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content>
  <div id="work-index-content">
    <div class="work-module-content" *ngFor="let module of menu" [hidden]="module.isHidden">
      <ion-item-divider>
        {{module.name}} <span *ngIf="module.module!='my'">（{{module.module}}）</span>
      </ion-item-divider>
      <div class="blank-tips" *ngIf="module.list.length==0">
        请点击编辑，定制属于你的个人办公
      </div>
      <div class="work-item" *ngFor="let item of module.list" (tap)="openPage(item)" [hidden]="item.isHidden" [attr.data-id]="item.id">
        <div class="icon-content" [ngStyle]="{'background-color':item.color}" (press)="beginEdit()">
          <i class="triangle-bg" *ngIf="module.module=='my'"></i>
          <div class="triangle-name" *ngIf="module.module=='my'" [ngStyle]="{'background-color':module.color}">{{item.id.split("-")[0]}}</div>
          <i class="iconfont {{item.icon}}"></i>
          <ion-icon *ngIf="isEdit && !(_.find(menu[0].list,{id:item.id}))" class="operate-icon add" name="add" (click)="addToMy(item)"></ion-icon>
          <ion-icon *ngIf="isEdit && (_.find(menu[0].list,{id:item.id}))" class="operate-icon remove" name="remove" (click)="removeFromMy(item)"></ion-icon>
        </div>
        <p>{{item.name}}</p>
      </div>
    </div>
  </div>

  <!-- <ion-grid>
    <ion-col width-33 *ngFor="let item of menu[0]" (click)="openPage(item)">
      <img src="assets/img/work/{{item.icon}}">
    </ion-col>
  </ion-grid> -->
</ion-content>
